/*
 * Copyright (c) 2006, 2023, webrx.cn All rights reserved.
 *
 */
package cn.reg;

/**
 * <p>Project: jse2302 - RegExp2
 * <p>Powered by webrx On 2023-06-20 11:42:24
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com] 13014577033
 * @version 1.0
 * @since 17
 */
public class RegExp2 {
    public static void main(String[] args) {
        //有没有汉字
        String name = "jac李k";
        String pattern = ".*[\\u4e00-\\u9fa5].*";
        System.out.println(name.matches(pattern));

        //有没有数字
        System.out.println("hello".matches(".*[0-9].*"));
        System.out.println("hello-123".matches(".*[0-9].*"));
        System.out.println("sqlserver".matches(".*[0-9].*"));

        //判断是不是标准的手机号 abc
        String phone = "13014577039".trim();
        // \d{9}  [0-9]{9}
        String pp = "1[358]\\d{9}";
        System.out.println(phone.matches(pp));
    }
}
